#include<stdio.h>

int main() {
	long mod = 1000000000;
	long sum = 0;
	long f = 1;
	for (long i = 1; i <= 202320232023; i++)
	{
		f = (f * i) % mod;
		sum = (sum + f) % mod;
	}
	printf("%d", sum);
	return 0;
}